{% extends "base.html" %}

{% block content %}
    <h1>Hi, {{ user.username }}!</h1>
    
    <form action="" method="post" novalidate>
        {{ form.hidden_tag() }}
        <p>
            {{ form.query.label }}
            {{ form.query(size=32) }}
            {{ form.submit() }}
            {% for error in form.query.errors %}
            <span style="color: red;">[{{ error }}]</span>
            {% endfor %}
        </p>
    </form>

    {% for post in posts %}
    <div><p>{{ post.author.username }} says: <b>{{ post.body }}</b></p></div>
    {% endfor %}
{% endblock %}
